package model;



public class ServerShape {

	private int x1,x2,y1,y2;
	//private int locationX, locationY;
	private boolean selected;

	public int getX1() {
		return x1;
	}

	public void setX1(int x1) {
		this.x1 = x1;
	}

	public int getX2() {
		return x2;
	}

	public void setX2(int x2) {
		this.x2 = x2;
	}

	public int getY1() {
		return y1;
	}

	public void setY1(int y1) {
		this.y1 = y1;
	}

	public int getY2() {
		return y2;
	}

	public void setY2(int y2) {
		this.y2 = y2;
	}
/*
	public int getLocationX() {
		return locationX;
	}

	public void setLocationX(int locationX) {
		this.locationX = locationX;
	}

	public int getLocationY() {
		return locationY;
	}

	public void setLocationY(int locationY) {
		this.locationY = locationY;
	}
	*/

	public boolean isSelected() {
		return selected;
	}

	public void setSelected(boolean selected) {
		this.selected = selected;
	}

	public void parse(String args) {
	      String[] attrs = new String[20];
	      attrs = args.split(";");
	      x1 = Integer.parseInt(attrs[0]);
	      x2 = Integer.parseInt(attrs[1]);
	      y1 = Integer.parseInt(attrs[2]);
	      y2 = Integer.parseInt(attrs[3]);
	      //locationX = Integer.parseInt(attrs[4]);
	      //locationY = Integer.parseInt(attrs[5]);
	      selected = attrs[6].equals("sel");  
	}

	  public String asString(){
	      String result=x1+";"+x2+";"+y1+";"+y2;
	      result+=";" + x1;//locationX;
	      result+=";" + y1;//locationY;
	      if (selected)
		     result+=";sel";
		  else	      
		     result+=";notsel";
	      return result;
	  }

}
